//
//  MainListBaseViewController.m
//  片刻
//
//  Created by lanou3g on 15/6/3.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MainListBaseViewController.h"
#import "MaocHeader.h"

//导航器

@interface MainListBaseViewController ()

@end

@implementation MainListBaseViewController

-(void)dealloc
{
    [self.rootRightVC release];
    [self.naviView release];
    [self.naviLabel release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createNaviBar];
    [self createChangeFrameButton];  //添加button
}

-(void)createNaviBar{
    
    self.naviView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 50)];
    self.naviView.backgroundColor = [UIColor whiteColor];
    self.naviLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 10, 80, 30)];
//    self.naviLabel.text = @"标题";
//  标题的丨
    UILabel *label1= [[UILabel alloc] initWithFrame:CGRectMake(47, 0, 1, 50)];
    label1.backgroundColor = [UIColor grayColor];
    label1.alpha = 0.3;
//    标题的横
    UILabel *label2= [[UILabel alloc] initWithFrame:CGRectMake(0, 49.5, SCREEN_WIDTH, 0.5)];
    label2.backgroundColor = [UIColor grayColor];
    label2.alpha = 0.3;
    [self.view addSubview:_naviView];
    [self.naviView addSubview:_naviLabel];
    [self.naviView addSubview:label1];
    [self.naviView addSubview:label2];
    
    [self.naviView release];
    [self.naviLabel release];
    [label1 release];
}

//创建button的方法
-(void)createChangeFrameButton
{
    self.image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"chouTi"]];
    _image.frame = CGRectMake(10, 10, 30, 30);
    UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
    button.frame = CGRectMake(0, 0, 40, 50);
    [button addTarget:self action:@selector(handleChangeFramButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.naviView addSubview:self.image];
    [self.naviView addSubview:button];
    
    [self.image release];
}
//button的点击事件
-(void)handleChangeFramButtonAction:(UIButton *)button
{
    [self.rootRightVC handleChangeframeButtonAction];//图片偏移
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end



